/**
 * 
 */
package org.mhz.ootw.controller;

import javax.annotation.Resource;

import org.mhz.ootw.service.MenuService;
import org.mhz.ootw.service.XMLMenuService;
import org.mhz.ootw.util.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author Mahan
 *
 * Welcome controller
 */
@Controller
public class WelcomeController
{
	private static final Logger LOGGER = LoggerFactory.getLogger(WelcomeController.class);
	
	@Resource(name = Constants.XML_MENU_SERVICE)
	private MenuService mXMLMenuService;
	
    /**
     * @return The model and view for the welcome request
     */
    @RequestMapping(Constants.WELCOME)
    public ModelAndView welcome()
    {
    	final String menuAsXML = mXMLMenuService.getMenu();

        return new ModelAndView(Constants.WELCOME_VIEW, Constants.MENU_MODEL, menuAsXML);
    }
}
